<?php

namespace maotool\output;

/**
 * 数据打印
 */
class Printf
{

    /**
     * 格式化参数
     * @param $param
     * @return false|string
     */
    private static function format($param)
    {
        return json_encode($param);
    }

    public static function text(...$params)
    {
        foreach ($params as $param) {
            echo self::format($param);
        }
    }

    public static function html(...$params)
    {
        foreach ($params as $param) {
            echo "<div>";
            echo self::format($param);
            echo "</div>";
        }
    }

}